package o;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

public abstract class bkq {
    private static final char[] ˎ = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
    private static final char[] ˏ = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};

    @NonNull
    public static char[] ˏ(@Nullable byte[] bArr, boolean z) {
        return ˋ(bArr, z ? ˎ : ˏ);
    }

    @NonNull
    private static char[] ˋ(@Nullable byte[] bArr, @NonNull char[] cArr) {
        int i = 0;
        if (bArr == null) {
            return new char[0];
        }
        int length = bArr.length;
        char[] cArr2 = new char[(length << 1)];
        for (int i2 = 0; i2 < length; i2++) {
            int i3 = i + 1;
            cArr2[i] = cArr[(bArr[i2] & 240) >>> 4];
            i = i3 + 1;
            cArr2[i3] = cArr[bArr[i2] & 15];
        }
        return cArr2;
    }

    @NonNull
    public static String ˋ(@Nullable byte[] bArr) {
        return ˊ(bArr, false);
    }

    @NonNull
    public static String ˊ(@Nullable byte[] bArr, boolean z) {
        if (bArr == null) {
            return "";
        }
        return new String(ˏ(bArr, z));
    }
}
